from django import forms

from .models import Tasks


class AddTaskForm(forms.ModelForm):

    title = forms.CharField(label='Название', max_length=100)
    description = forms.CharField(label='Описание', widget=forms.Textarea(attrs={'rows':4, 'cols':20}), required=False)
    start_img = forms.ImageField(label='Изображение', required=False)
    remind_by_date = forms.DateField(label='Напомнить', required=False)
    
    class Meta:
        model = Tasks
        fields = ['title', 'description', 'start_img', 'remind_by_date']


class ChangeTaskForm(forms.ModelForm):

    class Meta:
        model = Tasks
        fields = ('title', 'description', 'done_comment', 'start_img', 'end_img', 'is_done', 'remind_by_date')


class TaskDoneForm(forms.ModelForm):

    class Meta:
        model = Tasks
        fields = ('done_comment', 'end_img', 'is_done', 'ended_date')

    is_done = forms.BooleanField(required=False)